const path = require('path')
const fs = require('fs');
const { app } = require('electron');
const moment = require('moment');

function timestampFormat(timestamp, format) {
    if(!timestamp){
        return '';
    }
    const date = moment.unix(timestamp); // 使用 moment.unix() 将时间戳转为 Moment 对象
    return date.format(format);
}

// 示例
// const timestamp = 1644144000; // 10位时间戳
// const customFormat = 'YYYY-MM-DD HH:mm:ss';
// const formattedDateTime = timestampToCustomFormat(timestamp, customFormat);
// console.log(formattedDateTime);


module.exports = {
    timestampFormat,
};
